package com.heima.comment.feign;

import com.heima.model.article.dtos.ArticleSimpleInfoDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.article.pojos.ApAuthor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("leadnews-article")
public interface ArticleFeign {
    @GetMapping("/api/v1/article/ids/{authorId}")
    List<ArticleSimpleInfoDto> findArticleIdsByAuthorId(@PathVariable Long authorId);

    @PostMapping("/api/v1/article/getByArticeIdAndAuthorId")
    List<ApArticle> findArticleIdsByAuthorIdAndArticleId(@RequestParam("authorId") Long authorId, @RequestParam("articleId")Long articleId);
}
